package dict

import (
	"xpms/controllers"
)

// 字典管理
type DictController struct {
	controllers.BaseController
}

// @Title GetAll
// @Description get all Dicts
// @Param	dictTypeCode		query 	[]string			"The dictTypeCode for dict"
// @Param	projectid		query 	[]string			"The projectid for dict"
// @Param	dictid		query 	[]string			"The dictid for dict"
// @Success 200 {object} []dict.Dict
// @router / [get]
func (u *DictController) GetAll() {
	dictTypeCode := u.GetStrings("dictTypeCode")
	projectid := u.GetStrings("projectid")
	dictid := u.GetStrings("dictid")
	condArr := make(map[string]interface{})
	condArr["dictType"] = dictTypeCode
	condArr["dictid"] = dictid
	condArr["projectid"] = projectid
	result := DictListExec(condArr)
	u.Data["json"] = result
	u.ServeJSON()
}

// @Title GetAll
// @Description get all day
// @Success 200 {object} []dict.Dict
// @router /day/list [get]
func (u *DictController) DayList() {
	condArr := make(map[string]interface{})
	result := DayListExec(condArr)
	u.Data["json"] = result
	u.ServeJSON()
}
